set OLDDIR=%CD%

echo CMD ARGS = %*

call %1\bin\setWLSEnv.cmd
cd %OLDDIR%
SHIFT
set BASEDIR=%1
SHIFT
set SERVICE_BASE_DIR=%1
SHIFT
set SERVICE_VERSION=%1
SHIFT
set SERVICE_NAME=%1
SHIFT
set SERVICE_DOMAIN_NAME=%1
SHIFT
set SERVICE_SHORT_NAME=%1
SHIFT
set RELEASE_NUMBER=%1
SHIFT
set CONTEXT_PATH=%1
SHIFT
set MODEL_SERVICE_NAME=%1
SHIFT
set MODEL_SERVICE_SHORT_NAME=%1
SHIFT
set MAVEN_LOCAL_REPO=%1
SHIFT
set WAR_MODULE=%1
SHIFT
set TYPES_MODEL_PACKAGE=%1

echo BASEDIR: %BASEDIR%
echo MODEL_SERVICE_SHORT_NAME: %MODEL_SERVICE_SHORT_NAME%
echo TYPES_MODEL_PACKAGE: %TYPES_MODEL_PACKAGE%

IF [%TYPES_MODEL_PACKAGE%] == [] GOTO NORMAL
echo Invoking Service Version
call ant -d -v -Dbasedir=%BASEDIR% -Dservice.base.dir=%SERVICE_BASE_DIR% -Dservice.version=%SERVICE_VERSION% -Dservice.name=%SERVICE_NAME% -Dservice.domain.name=%SERVICE_DOMAIN_NAME% -Dservice.short.name=%SERVICE_SHORT_NAME% -Drelease.number=%RELEASE_NUMBER% -Dcontext.path=%CONTEXT_PATH% -Dmodel.service.name=%MODEL_SERVICE_NAME% -Dmodel.service.short.name=%MODEL_SERVICE_SHORT_NAME% -Dtypes.model.package=%TYPES_MODEL_PACKAGE% -Dbea.home=%BEA_HOME% -Dmaven.local.repo=%MAVEN_LOCAL_REPO% -Dwarmodule=%WAR_MODULE% -buildfile %SERVICE_BASE_DIR%/build.xml ntd:jwsc_call
GOTO END

:NORMAL
echo Invoking Service
call ant -d -v -Dbasedir=%BASEDIR% -Dservice.base.dir=%SERVICE_BASE_DIR% -Dservice.version=%SERVICE_VERSION% -Dservice.name=%SERVICE_NAME% -Dservice.domain.name=%SERVICE_DOMAIN_NAME% -Dservice.short.name=%SERVICE_SHORT_NAME% -Drelease.number=%RELEASE_NUMBER% -Dcontext.path=%CONTEXT_PATH% -Dmodel.service.name=%MODEL_SERVICE_NAME% -Dmodel.service.short.name=%MODEL_SERVICE_SHORT_NAME% -Dbea.home=%BEA_HOME% -Dmaven.local.repo=%MAVEN_LOCAL_REPO% -Dwarmodule=%WAR_MODULE% -buildfile %SERVICE_BASE_DIR%/build.xml ntd:jwsc_call
:END


